package com.dong.classovertest;

import com.dong.entity.User;

import java.util.Objects;

public class Piece {
    private Double x;
    private Double y;
    private String color;

    public Piece() {
    }

    public Piece(Double x, Double y, String color) {
        this.x = x;
        this.y = y;
        this.color = color;
    }

    public Double getX() {
        return x;
    }

    public void setX(Double x) {
        this.x = x;
    }

    public Double getY() {
        return y;
    }

    public void setY(Double y) {
        this.y = y;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    @Override
    public String toString() {
        return "Piece{" +
                "x=" + x +
                ", y=" + y +
                ", color='" + color + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Piece piece = (Piece) o;
      if(x.equals(piece.x)&& y.equals(piece.y)){
          return true;
      }
          return false;

    }
}

